﻿@using ZX.Tools
@using ZX.Model
@model MyEntertain
@{
    Sys_UserModel user = ViewBag.User;
    List<Sys_User> userList = ViewBag.UserList ?? new List<Sys_User>();
    string userSign0 = "";
    string userSign1 = "";
    string userSign2 = "";
}
<link href="~/Static/styles/bootstrap.min.css" rel="stylesheet" />
<link href="~/Static/js/layui/css/layui.css" rel="stylesheet" />
<script src="/Static/js/jquery/jquery-1.11.1.min.js"></script>
<script src="~/Static/js/layui/layui.js"></script>
<div class='row page-content'>
    <div class='panel'>
        <div class='panel-heading'><strong><i class='icon-building'></i>招待审批单</strong></div>
        <div class='panel-body'>
            <form action="/MyEntertain/SaveApproval" method="post" class="form" id="formMyEntertain">
                <input type="hidden" name="Id" value="@Model.Id" />
                <input type="hidden" name="status" value="@ApplyStatus.驳回.ToInt()" />
                <input type="hidden" name="deptId" value="@user.Fk_DeptId" />
                <table class='table table-bordered' style="border: 1px solid #ddd;">
                    <tr>
                        <th class='text-center w-100px'>申请部门</th>
                        <td>
                            @user.DeptName
                        </td>
                        <th class="text-center w-100px">申请人</th>
                        <td>
                            @user.RealName
                        </td>
                        <th class='text-center w-100px'>日期</th>
                        <td>
                            @(Model.AddTime.ToDateFormat("yyyy-MM-dd"))
                        </td>
                    </tr>
                    <tr>
                        <th class="text-center">客人单位</th>
                        <td colspan="2">@Model.KeCompanyName</td>
                        <th class="text-center">客人人数</th>
                        <td colspan="2">
                            @(Model.KeCount + "人")
                        </td>
                    </tr>
                    <tr>
                        <th class="text-center">陪餐人员</th>
                        <td colspan="5">@Model.AccompanyDinner</td>
                    </tr>
                    <tr>
                        <th class="text-center">招待事项</th>
                        <td colspan="2">
                            @(Model.ESxiang)
                        </td>
                        <th class="text-center">招待级别</th>
                        <td colspan="2">
                            @(Model.ELevel)
                        </td>
                    </tr>
                    <tr>
                        <th class="text-center">申请事由</th>
                        <td colspan="2">
                            @Model.ADesc
                        </td>
                        <th class="text-center">所需费用</th>
                        <td colspan="2">
                            @(Model.TotalMoney + "元")
                        </td>
                    </tr>


                    @{
                        try
                        {
                            userSign0 = userList[0].USgin;
                        }
                        catch { }

                        try
                        {
                            userSign1 = userList[1].USgin;
                        }
                        catch { }

                        try
                        {
                            userSign2 = userList[2].USgin;
                        }
                        catch { }
                    }


                    <tr>
                        <th class="text-center">部门负责人</th>
                        <td>
                            @if (userSign2.IsNotNullOrEmpty())
                            {
                                <img src="@userSign2" style="width:200px;height:50px;margin-left:7px;" /><br />
                            }
                        </td>
                        <th class="text-center">综合部审核</th>
                        <td>
                            @if (userSign1.IsNotNullOrEmpty())
                            {
                                <img src="@userSign1" style="width:200px;height:50px;margin-left:7px;" /><br />
                            }
                        </td>
                        <th class="text-center">总经理审批</th>
                        <td>
                            @if (userSign0.IsNotNullOrEmpty())
                            {
                                <img src="@userSign0" style="width:200px;height:50px;margin-left:7px;" /><br />
                            }
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(function () {
        onprint();
    });
    function printHtml(html) {
        var bodyHtml = html;
        document.body.innerHTML = html;
        window.print();
        document.body.innerHTML = bodyHtml;
    }
    function onprint() {
        var html = $(".panel-body").html();
        printHtml(html);
    }
</script>
